/**
 * Created by FDG282 on 2017/9/11.
 */
    //进口家具页面banner效果
$(function() {
    var galleryTop = new Swiper('.gallery-top', {
        spaceBetween: 20,
        direction: 'horizontal'
    });
    var galleryThumbs = new Swiper('.gallery-thumbs', {
        nextButton: '.swiper-button-next',
        prevButton: '.swiper-button-prev',
        spaceBetween:10,
        centeredSlides: true,
        slidesPerView: 'auto',
        touchRatio: 0.1,
        slideToClickedSlide:true,
        direction: 'horizontal'
    });
    galleryTop.params.control = galleryThumbs;
    galleryThumbs.params.control = galleryTop;

    $('.match_goods_list').click(function (event) {
        event.preventDefault();
        var url = $(this).attr("href");
        var cate_id = "<?=$cate_id?>";
        var buy_set_id = 0;
        $('li.swiper-slide').each(function(){
            if($(this).hasClass('swiper-slide-active')){
                buy_set_id = $(this).attr("data-buy-set");
            }
        })
        if (url.indexOf('?') > 0) {
            url += '&buy_set=' + buy_set_id;
        } else {
            url += '?cate_id=' + cate_id + '&buy_set=' + buy_set_id;
        }
        window.location.href = url;
    });
});
